package com.waters321.rock.web.api.demo;

import java.util.Random;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.waters321.rock.orm.entity.business.BusinessDemo;
import com.waters321.rock.orm.entity.frame.FrameDemo;
import com.waters321.rock.web.api.ApiController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/demo")
@Api(tags = "示例分类")
public class DemoController extends ApiController {

  @RequestMapping(method = {RequestMethod.GET})
  @ApiOperation(value = "示例方法")
  public BusinessDemo test() {
    FrameDemo insert = new FrameDemo();
    insert.setName("名字" + new Random().nextInt(1000));
    insert.insert();

    BusinessDemo insert2 = new BusinessDemo();
    insert2.setName("名字" + new Random().nextInt(1000));
    insert2.insert();

    return insert2;
  }
}
